<?php
// +----------------------------------------------------------------------
// | Description: 1
// +----------------------------------------------------------------------
// | Author: orchief
// +----------------------------------------------------------------------
// | Date: 2018-01-24 15:37:11
// +----------------------------------------------------------------------

namespace app\client\controller;

use app\common\controller\Rest;

class Products extends Rest
{
    public $modelName = 'Product';
    public function _initialize()
    {
        parent::_initialize();
    }

    public function index()
    {
        $data = self::$model->getDataList();
        $this->jsonData($data, self::$model -> getError());
    }

    public function enables()
    {
        $res = self::$model->enableDatas($this->param['ids'], $this->param['status'], 'OnSale');
        $this->checkRes($res, '批量操作成功', self::$model->getError());
    }
}
